import { reactive } from 'vue'
import axios from 'axios'

export default function () {
    let dogList: string[] = reactive([])

    async function addDog() {
        try {
            let result = await axios.get('https://dog.ceo/api/breeds/image/random')
            // console.log(result)
            dogList.push(result.data.message)
        } catch (error) {
            alert(error)
        }
    }
    
    return {dogList, addDog}
}

